package com.ecloud.gardenscenter.controller;

import com.ecloud.gardenscenter.common.JsonResult;
import com.ecloud.gardenscenter.service.MqttService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Squbi
 */
@RestController
public class MqttController {
    @Autowired
    private MqttService service;

    @PostMapping("/mqtt/switch/temp")
    public JsonResult sendSwitch(String topic, int deviceId, int operation) {
        service.sendSwitch(topic, deviceId, operation);
        return JsonResult.success();
    }
}
